
package {{package}};

{{#MainTest-java-imports}}
import {{.}};
{{/MainTest-java-imports}}

{{#MainTest-helidon-imports}}
import {{.}};
{{/MainTest-helidon-imports}}

{{#MainTest-other-imports}}
import {{.}};
{{/MainTest-other-imports}}

{{#MainTest-static-imports}}
import {{.}};
{{/MainTest-static-imports}}

@TestMethodOrder(MethodOrderer.MethodName.class)
public class MainTest {

{{#MainTest-static-fields}}
{{.}}
{{/MainTest-static-fields}}

    private static WebServer webServer;
    private static WebClient webClient;

    @BeforeAll
    public static void startTheServer() {
        webServer = Main.startServer().await();

        webClient = WebClient.builder()
                .baseUri("http://localhost:" + webServer.port())
{{#MainTest-clientBuilder}}
{{.}}
{{/MainTest-clientBuilder}}
                .build();
    }

    @AfterAll
    public static void stopServer() throws Exception {
        if (webServer != null) {
            webServer.shutdown()
                    .toCompletableFuture()
                    .get(10, TimeUnit.SECONDS);
        }
    }

{{#MainTest-methods}}
{{.}}
{{/MainTest-methods}}
}
